﻿@model NewLife.School.Entity.Student
@using NewLife;
@using XCode;
@using XCode.Configuration;
@using NewLife.School.Entity;
@{
    var entity = Model;
    var fields = ViewBag.Fields as IList<FieldItem>;
    var isNew = (entity as IEntity).IsNullKey;
}
<div class="form-group col-xs-12 col-sm-6 col-lg-4">
    <label class="control-label col-xs-3 col-sm-3">班级</label>
    <div class="input-group col-xs-9 col-sm-9">
        @Html.ForDropDownList("ClassID", Student.Meta.AllFields.First(e=>e.Name=="ClassName").Map.Provider.GetDataSource(), @entity.ClassID)
    </div>
</div>
<div class="form-group col-xs-12 col-sm-6 col-lg-4">
    <label class="control-label col-xs-3 col-sm-3">名称</label>
    <div class="input-group col-xs-9 col-sm-9">
        <input class="form-control" id="Name" name="Name" type="text" value="@entity.Name" />
    </div>
</div>
<div class="form-group col-xs-12 col-sm-6 col-lg-4">
    <label class="control-label col-xs-3 col-sm-3">性别xyz</label>
    <div class="input-group col-xs-9 col-sm-9">
        @Html.ForEnum("Sex", @entity.Sex)
    </div>
</div>
<div class="form-group col-xs-12 col-sm-6 col-lg-4">
    <label class="control-label col-xs-3 col-sm-3">年龄</label>
    <div class="input-group col-xs-9 col-sm-9">
        @Html.TextBox("Age", @entity.Age, new { @class = "form-control", role="number" })
    </div>
</div>
<div class="form-group col-xs-12 col-sm-6 col-lg-4">
    <label class="control-label col-xs-3 col-sm-3">手机</label>
    <div class="input-group col-xs-9 col-sm-9">
        <div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-phone"></i></span><input class="form-control" id="Mobile" name="Mobile" type="tel" value="@entity.Mobile" /></div>
    </div>
</div>
<div class="form-group col-xs-12 col-sm-6 col-lg-4">
    <label class="control-label col-xs-3 col-sm-3">地址</label>
    <div class="input-group col-xs-9 col-sm-9">
        <input class="form-control" id="Address" name="Address" type="text" value="@entity.Address" />
    </div>
</div>
@Html.Partial("_Form_Footer", entity)
@if (this.Has(PermissionFlags.Insert, PermissionFlags.Update))
{
    <div class="clearfix form-actions col-sm-12 col-md-12">
        <label class="control-label col-xs-4 col-sm-5 col-md-5"></label>
        <button type="submit" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-@(isNew ? "plus" : "save")"></i><strong>@(isNew ? "新增" : "保存")</strong></button>
        <button type="button" class="btn btn-danger btn-sm" onclick="history.go(-1);"><i class="glyphicon glyphicon-remove"></i><strong>取消</strong></button>
    </div>
}